<template>
    <div class="PopupEnable">
        <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="visible" title=""
            :show-close="false" align-center class="dialogAdd1">
            <div class="dialog_content">
                <div class="dialog_header">
                    <div class="title">
                        <img src="@/assets/images/rectangle07.png" alt="">
                        <span>执行情况设置确认</span>
                    </div>
                </div>
                <div class="dialog_details">
                    <div class="details">
                        <div class="box1" v-if="true">
                            <div class="text">是否确定将所选工作执行状态设置为“已执行”？</div>
                            <el-form :model="state.formAdd" ref="formAddRef" :rules="rules" label-position="right"
                                class="form">
                                <el-form-item label="实际处理人" :label-width="formLabelWidth" prop="realName">
                                    <el-input v-model="state.formAdd.realName" autocomplete="off" />
                                </el-form-item>
                                <el-form-item label="实际监护人" :label-width="formLabelWidth" prop="realName">
                                    <el-input v-model="state.formAdd.realName" autocomplete="off" />
                                </el-form-item>
                                <el-form-item label="执行时间" :label-width="formLabelWidth">
                                    <el-date-picker v-model="value1" type="datetime" placeholder="执行时间" />
                                </el-form-item>
                                <el-form-item label="执行情况说明" :label-width="formLabelWidth">
                                    <el-input v-model="state.formAdd.realName" autocomplete="off" class="textarea"
                                        :autosize="{ minRows: 3, maxRows: 3 }" type="textarea" resize="none" />
                                </el-form-item>
                            </el-form>
                        </div>
                        
                        <div class="box2" v-if="false">
                            <div class="text">是否确定将所选工作执行状态设置为“取消执行”？</div>
                            <el-form :model="state.formAdd2" ref="formAddRef" :rules="rules" label-position="right"
                                class="form">
                                <el-form-item label="取消原因" :label-width="formLabelWidth">
                                    <el-input v-model="state.formAdd.realName" autocomplete="off" class="textarea"
                                        :autosize="{ minRows: 3, maxRows: 3 }" type="textarea" resize="none" />
                                </el-form-item>
                            </el-form>
                        </div>
                        
                        <div class="box3" v-if="false">
                            <div class="text">是否确定将所选工作执行状态设置为“延期”？</div>
                            <el-form :model="state.formAdd3" ref="formAddRef" :rules="rules" label-position="right"
                                class="form">
                                <el-form-item label="延期处理时间" :label-width="formLabelWidth">
                                    <el-date-picker v-model="value1" type="datetime" placeholder="延期处理时间" />
                                </el-form-item>
                                <el-form-item label="延期原因" :label-width="formLabelWidth">
                                    <el-input v-model="state.formAdd.realName" autocomplete="off" class="textarea"
                                        :autosize="{ minRows: 3, maxRows: 3 }" type="textarea" resize="none" />
                                </el-form-item>
                            </el-form>
                        </div>
                        <div class="btn">
                            <el-button type="warning" @click="handleClose">确 认</el-button>
                            <el-button @click="handleClose">取 消</el-button>
                        </div>
                    </div>

                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script setup lang="ts">
import type { FormInstance, FormRules, CheckboxValueType } from 'element-plus'

let formLabelWidth = '135px'

const value1 = ref('')

const props = defineProps({
    dialogVisible: {
        type: Boolean,
        default: false
    },
})

const state = reactive({
    formAdd: {
        realName: '',
    },
    formAdd2: {
        realName: '',
    },
    formAdd3: {
        realName: '',
    }
})

const rules = reactive<FormRules>({
    realName: [
        { required: true, message: '真实姓名不能为空', trigger: 'blur' },
    ],
})
let visible = ref(false);

watch(() => props.dialogVisible, async (newValue, oldValue) => {
    visible.value = newValue;

});

//emit(父组件中的自定义方法)
const emit = defineEmits(['closeDialog']);

const handleClose = () => {
    emit("closeDialog");
}
</script>

<style scoped lang="scss">
.PopupEnable {
    :deep(.dialogAdd1) {
        width: 500px;
        // width: 640px;
        min-height: 440px;
        background: rgba(255, 255, 255, 1);
        border-radius: 2px;
        box-shadow: 0px 6px 16px -8px rgba(0, 0, 0, 0.08), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 12px 48px 16px rgba(0, 0, 0, 0.03);

        .el-dialog__header {
            padding: 0;

        }

        .el-dialog__body {
            padding: 0;

            .dialog_content {
                .dialog_header {
                    padding: 0;
                    height: 59px;
                    padding: 8px 32px 4px 62px;
                    line-height: 52px;
                    font-size: 16px;
                    font-weight: 400;
                    color: rgba(0, 0, 0, 1);
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    border-bottom: 1px dashed rgba(112, 105, 95, 1);

                    .title {
                        display: flex;
                        align-items: center;

                        img {
                            width: 4px;
                            height: 22px;
                            margin-right: 15px;
                        }

                    }

                    .close {
                        width: 25px;
                        height: 25px;
                        cursor: pointer;

                    }
                }

                .dialog_details {
                    padding: 25px 45px 50px 48px;
                    font-size: 16px;
                    font-weight: 400;
                    letter-spacing: 0px;
                    line-height: 30px;
                    color: rgba(0, 0, 0, 1);

                    .details {
                        text-align: center;

                        .text {
                            margin-bottom: 10px;
                        }

                        .textarea {
                            width: 260px;
                        }

                        .el-form {
                            display: block;

                            .el-form-item {
                                margin-bottom: 15px;
                            }

                            .el-radio {
                                margin-right: 20px;
                            }

                            .btn {
                                width: 100%;
                                text-align: right;
                                padding-right: 0;
                            }
                        }

                        .btn {
                            position: absolute;
                            bottom: 40px;
                            right: 77px;
                        }
                    }

                }

            }
        }


    }
}
</style>